<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport"
		content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
	<meta name="referrer" content="never">
	<title>值班长</title>
	<link rel="stylesheet" href="css/vant.css">
	<link rel="stylesheet" href="css/shareDownPage.css">
</head>

<body>
	<div id="app" v-cloak>
		<div class="shareTit">
			<div>
				<span>ZHI</span>
				<span>BAN</span>
				<span>ZHANG</span>
			</div>
			<div>
				<span>健</span>
				<span>康</span>
				<span>科</span>
				<span>普</span>
				<span>护</span>
				<span>佑</span>
				<span>健</span>
				<span>康</span>
			</div>
		</div>
		<div class="shopInfo" v-if="shopInfo!=''">
			<div>{{shopInfo.shopName}}</div>
			<div>地址：{{shopInfo.shopAddres==null?'暂无地址信息':shopInfo.shopAddres}}</div>
			<div>联系电话：{{shopInfo.shopTel==null?'暂无联系电话':shopInfo.shopTel}}</div>
		</div>
		<div class="zbzLogo">
			<!-- <img src="./img/about.png" alt="logo"> -->
			<div>
				<span>全病程管理</span>
				<span>享受健康生活就来吉医护理</span>
			</div>
		</div>
		<div class="pageMain">
			<img class="topMain" src="img/sharePage2.png" alt="">
			<img class="bottomMain" src="img/sharePage1.png" alt="">
		</div>
		<!-- 按钮 -->
		<div class="btn" @click="downHandle">
			立即下载
		</div>
		<button id="downloadBtn" style="display: none;">立即下载 </button>
		<div class="downBox" v-if="showPop" @click="showPop=false">
			<img src="./img/downTip.png" alt="">
		</div>
	</div>



	<script src="js/vue.min.js"></script>
	<script src="js/flex_ible/lib-flexible.js"></script>
	<script src="js/vue-lazyload.js"></script>
	<script src="js/vant.min.js"></script>
	<script src="js/vue-lazyload.js"></script>
	<script src="js/url.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="https://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
	<script src="js/ajax.js"></script>
	<script>
		var ua = navigator.userAgent.toLowerCase();
		var isWeixin = ua.indexOf('micromessenger') != -1;

		console.log(isWeixin);
		Vue.use(VueLazyload);
		var vm = new Vue({
			el: "#app",
			data: {
				showPop: false,
				shopInfo: sessionStorage.getItem('shop') == null ? '' : JSON.parse(sessionStorage.getItem('shop'))
			},
			created() {
				if (this.shopInfo != '') {
					this.setTitle(this.shopInfo.shopName)
				}
			},
			methods: {
				setTitle(name) {
					document.title = name
					const i = document.createElement('iframe')
					i.src = '/favicon.ico'
					i.style.display = 'none'
					i.onload = function () {
						setTimeout(function () {
							i.remove()
						}, 9)
					}
					document.body.appendChild(i)

				},



				downHandle: function () {
					// if (window.navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
					//     console.log("000");
					//     var loadDateTime = new Date();
					//     window.location = "clinic://"; //schema链接或者universal link
					//     window.setTimeout(
					//         function () { //如果没有安装app,便会执行setTimeout跳转下载页
					//             var timeOutDateTime = new Date();
					//             if (timeOutDateTime - loadDateTime < 5000) {
					//                 window.location =
					//                     "https://itunes.apple.com/cn/app/%E5%80%BC%E6%97%A5%E7%94%9F/id1448441059?mt=8"; //ios下载地址  
					//             } else {
					//                 window.close();
					//             }
					//         }, 500);
					// } else if (window.navigator.userAgent.match(/android/i)) {
					//     var state = null;
					//     try {
					//         window.location = 'clinic://'; //schema链接或者universal link
					//         window.setTimeout(
					//             function () {
					//                 window.location =
					//                     "https://a.app.qq.com/o/simple.jsp?pkgname=com.ccclkj.clinic";
					//                 //window.location = "http://www.ccclkj.cn:1125/zbz.apk"; 
					//                 //android下载地址  
					//             }, 500);
					//     } catch (e) { }
					// }

					if (isWeixin) {
						this.showPop = true
					} else {
						if (window.navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
							console.log("000");
							var loadDateTime = new Date();
							window.location = "clinic://"; //schema链接或者universal link
							window.setTimeout(
								function () { //如果没有安装app,便会执行setTimeout跳转下载页
									var timeOutDateTime = new Date();
									if (timeOutDateTime - loadDateTime < 5000) {
										window.location =
											"https://itunes.apple.com/cn/app/%E5%80%BC%E6%97%A5%E7%94%9F/id1448441059?mt=8"; //ios下载地址  
									} else {
										window.close();
									}
								}, 500);
						} else if (window.navigator.userAgent.match(/android/i)) {
							var state = null;
							try {
								window.location = 'clinic://'; //schema链接或者universal link
								window.setTimeout(
									function () {
										window.location = "https://a.app.qq.com/o/simple.jsp?pkgname=com.ccclkj.clinic";
										//android下载地址  
									}, 500);
							} catch (e) { }
						}
					}

					// if (window.navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
					// 	console.log("000");
					// 	var loadDateTime = new Date();
					// 	window.location = "clinic://"; //schema链接或者universal link
					// 	window.setTimeout(
					// 		function () { //如果没有安装app,便会执行setTimeout跳转下载页
					// 			var timeOutDateTime = new Date();
					// 			if (timeOutDateTime - loadDateTime < 5000) {
					// 				window.location =
					// 					"https://itunes.apple.com/cn/app/%E5%80%BC%E6%97%A5%E7%94%9F/id1448441059?mt=8"; //ios下载地址  
					// 			} else {
					// 				window.close();
					// 			}
					// 		}, 500);
					// } else if (window.navigator.userAgent.match(/android/i)) {
					// 	var state = null;
					// 	try {
					// 		window.location = 'clinic://'; //schema链接或者universal link
					// 		window.setTimeout(
					// 			function () {
					// 				// alert(11);
					// 				window.location = "https://a.app.qq.com/o/simple.jsp?pkgname=com.ccclkj.clinic";
					// 				// window.location.href = "https://zbz-downlink.oss-cn-zhangjiakou.aliyuncs.com/com.ccclkj.clinic.apk";
					// 				// window.location.href = "https://www.pgyer.com/RI5D";
					// 				//android下载地址  
					// 			}, 500);
					// 	} catch (e) { }
					// }



				},

			}
		})
	</script>

</body>

</html>